<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>jQuery Mobile Web App</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc1/jquery.mobile-1.0rc1.min.css" />
<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-green-button-theme.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-red-button-theme.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery-1.5.min.js" type="text/javascript"></script>
<script src="js/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
 This reference to phonegap.js will allow for code hints as long as the current site has been configured as a mobile application. 
	 To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... 
<script src="js/phonegap.js" type="text/javascript"></script>

</head> 
<body> 
<script>
function onSuccess(data, status){
	data = $.trim(data);
	if(data == "1"){
		$("#register-success").click();
	}
	else if (data == "0"){
		$("#register-fail").click();
	}
}
function onError(data, status){

}
$(document).ready(function() {
	$("#submit").click(function(){
		var formData = $("#registerform").serialize();
		$.ajax({
			type: "POST",
			url: "register.php",
			cache: false,
			data: formData,
			success: onSuccess,
			error: onError
		});
		return false;
	});
});
</script>
<div data-role="page" data-theme="c">
	<div data-role="header" data-theme="a">
    <a href="" data-rel="back" data-role="button" data-icon="arrow-l">Back</a>
		<h3>Match n' Rent</h3>
	</div>
	<div data-role="content">
    <h3>Register account</h3>	
        <form id="registerform">
 

                <input type="text" name="username" id="username" class="bold" value=""  data-theme="c" placeholder="Username"/>

                <input type="password" name="password" id="password" class="bold" value="" data-theme="c" placeholder="Password"/>

                <input type="password" name="cpassword" id="cpassword" class="bold" value="" data-theme="c" placeholder="Confirm Password"/>
     
                <input type="text" name="email" id="email" class="bold" value=""  data-theme="c" placeholder="Email" />
     
                <input type="text" name="cemail" id="cemail" class="bold" value=""  data-theme="c" placeholder="Confirm Email"/>      

        	<input type="submit" id="submit" data-icon="check" data-iconpos="right" data-theme="b" value="Register" class="btn" />

		
        <a href="register_failed.html" id="register-fail" data-rel="dialog" data-transition="pop" ></a>
        <a href="register_success.html" id="register-success" data-rel="dialog" data-transition="pop" ></a>
        
        
	</div>
</div>
</body>
</html>